﻿using System;

namespace TicTacToe
{
    internal static class SymbolHelpers
    {
        internal static Symbol? CharToSymbol(char c)
        {
            switch (c)
            {
                case ' ':
                    return null;
                case 'x':
                    return Symbol.Cross;
                case 'o':
                    return Symbol.Nought;
                default:
                    throw new ArgumentException("The supplied board state must contain only the characters 'x', 'o', and ' '.");
            }
        }
    }
}
